package com.zhg.javakc.modules.relation.service;

import com.zhg.javakc.base.page.Page;
import com.zhg.javakc.base.service.BaseService;
import com.zhg.javakc.modules.materials.entity.MaterialsEntity;
import com.zhg.javakc.modules.relation.dao.RelationDao;
import com.zhg.javakc.modules.relation.entity.RelationEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

@Service
@Transactional(readOnly = true)
public class RelationService extends BaseService<RelationDao, RelationEntity> {
    @Autowired
    private RelationDao relationDao;


    public Page<RelationEntity> queryRelation(RelationEntity relationEntity,Page<RelationEntity> page){
        relationEntity.setPage(page);
        List<RelationEntity> list=relationDao.findList(relationEntity);
        page.setList(list);
        return page;
    }
    public List<Map<String,Object>> queryGroup(String groupPid){
        List<Map<String,Object>> list=relationDao.queryGroup(groupPid);
        return list;
    }
    public  List<Map<String,Object>> queryGam(){
        List<Map<String,Object>> list=relationDao.queryGam();
        return list;
    }
}
